

import ICapability from 'components/capability/interfaces/ICapability';
import { Element } from 'components/Three';
import * as THREE from 'three';
import Controller from 'Controller';
import React from 'react';

/** 环境光 */
export const ambientLight: ICapability<undefined> = {
    id: 'ambientLight',
    title: '环境光',
    useExpand: () => {

        const onClick = React.useCallback(() => {
            const ambientLight = new THREE.AmbientLight(0xffffff)
            const element = new Element('light', ambientLight.uuid, ambientLight);
            Controller.instance.state.threeController.sceneAdd(element);
        }, [])

        return {
            onClick,
        }
    }
}